from django.db import models


# class User(models.Model):
#     user = models.CharField(max_length=10)
#     password = models.CharField(max_length=10)
#     phone = models.IntegerField()
#
#
# class Area(models.Model):
#     name = models.CharField(max_length=10)
#     ppid = models.IntegerField()
#
#
# class UserAddress(models.Model):
#     user_id = models.ForeignKey(to='User', on_delete=models.CASCADE)
#     recipient = models.CharField(max_length=10)
#     provide = models.CharField(max_length=10)
#     city = models.CharField(max_length=10)
#     district = models.CharField(max_length=10)
#     phone = models.IntegerField()
#     site = models.CharField(max_length=10)

# 新闻表
class News(models.Model):
    title = models.CharField(max_length=100)
    content = models.TextField()

    class Meta:
        db_table = 'news'
        verbose_name = '新闻'
        verbose_name_plural = verbose_name


# 广告表
class Advert(models.Model):
    title = models.CharField(max_length=100)
    pic = models.ImageField(upload_to='news', null=True)
    url = models.CharField(max_length=255)

    class Meta:
        db_table = 'advert'
        verbose_name = '广告'
        verbose_name_plural = verbose_name
